<template>
  <div id="myComment">
    <el-card>
      <el-table :data="commentData" style="width: 100%; height: 600px; overflow: auto" border>
        <el-table-column type="index" align="center" label="编号" width="50px" show-overflow-tooltip></el-table-column>
        <el-table-column prop="nickname" label="评论人" min-width="20%" show-overflow-tooltip></el-table-column>
        <el-table-column prop="content" label="评论内容" min-width="60%" show-overflow-tooltip></el-table-column>
        <el-table-column prop="createTime" label="评论日期" min-width="20%" show-overflow-tooltip></el-table-column>
      </el-table>
    </el-card>
  </div>
</template>
<script>
import { Message } from 'element-ui'
export default {
  props: { },
  data() {
    return  {
      commentData: [],
    }
  },
  mounted() { },
  created() {
    this.queryDate()
  },
  methods: {
    queryDate() {
      this.commentData = []
      this.axios({
        baseURL: 'http://59.172.104.174:30669',
        url: '/systemmanagement/comment/commentByUserId',
        method: 'GET',
        params: {
          userId: JSON.parse(window.localStorage.getItem('pro__Login_Userinfo')).value.id,
        }
      }).then(res => {
        console.log('res', res)
        this.commentData = res.data.data.map((item) => {
          return { nickname: item.commentData.nickname, content: item.commentData.content, createTime: item.commentData.createTime }
        })
        console.log('this.commentData', this.commentData)
      })
    }
  },
}
</script>

<style lang="less" scoped>
#myComment {
  /deep/.el-table::before {
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0;
  }
}
</style>